const { Schema, model } = require("mongoose");

const commentSchema = new Schema({
    __v: { type: Number, select: false },
    author: { type: Schema.Types.ObjectId, ref: "User", required: true }, // 评论者
    blog: { type: Schema.Types.ObjectId, ref: "Blog", required: true }, // 博客
    content: { type: String, required: true, select: false }, // 内容
    createAt: { type: Date, default: Date.now }, // 创建时间
});

module.exports = model("Comment", commentSchema);
